import time

from common.base import Base, By


class LoginEcshop(Base):
    def input_username(self,locator, username):


        self.send_keys(locstor, username)


    def input_userpassword(self,locator, password):
        # 调用父类发送方法
        self.send_keys(locator, password)

    def remember(self, locator):
        # 调用父类点击方法
        self.click(locator)

    def btn_login(self, locator):
        # 调用父类点击方法
        self.click(locator)


if __name__ == '__main__':
    login = LoginEcshop('chrome')
    login.get('https://ecshop.test2.shopex123.com/user.php')
    login.send_keys((By.NAME, 'username'), 'yueyongjian')
    login.input_userpassword((By.NAME, 'password'), '123456')
    login.remember((By.NAME, 'remember'))
    login.btn_login((By.NAME, 'submit'))
    login.quit()


